window.onload=function(){
    let searchstr=location.search;
    let searchparams=new URLSearchParams(searchstr);
    let pid=searchparams.get("id");
    let uid=localStorage.getItem("id");
    if(!pid){
        alert('暂无收藏的职位')
    }else{
        axios.get(productdatailAPI,{params:{id:pid}})
        .then(res=>{
            let pobj=res.data.data;
            // console.log(pobj);
            let html=` <ul class="xqleftul">
            <li>${pobj.pdesc}</li>
            <li>${pobj.pname}</li>
            <li><p class="redp">${pobj.pprice}</p>/北京/经验1-3年/大专及以上/全职</li>
            <li><p class="dsbj">电商编辑</p><p class="dsbj">电商编辑</p><p class="dsbj">电商编辑</p></li>
            <li>1天前 发布于拉钩网</li>
        </ul>`
        let html1=`
        <ul>
                    <li><img src="${pobj.pimg}" alt="" style="background:#00b38a;width: 80px;height: 80px;"></li>
                    <li><i class="layui-icon layui-icon-app" style="font-size: 15px; color: #ccc;"></i>电子商务</li>
                    <li><i class="layui-icon layui-icon-chart-screen" style="font-size: 15px; color: #ccc;"></i>不需要融资</li>
                    <li><i class="layui-icon layui-icon-user" style="font-size: 15px; color: #ccc;"></i>50-150人</li>
                    <li style="border-bottom: solid 1px #ccc;"><i class="layui-icon layui-icon-home" style="font-size: 15px; color: #ccc;"></i>www.xiaopiu.com</li>
                </ul>
        `
        let txtrtop=document.querySelector('.txtrtop');
        txtrtop.innerHTML=html1;
        let xqOdiv=document.querySelector('.xqleft');
        xqOdiv.innerHTML=html;
        })
        let souchangbtn=document.querySelector('#souchang');
        souchangbtn.onclick=async function(){
            let pnum=1;
            let res=await axios.get(productaddproductAPI,{params:{uid,pid,pnum}});
            document.querySelector('#ccc').className="layui-icon layui-icon-rate-solid";
            console.log(res);
        }
    }
}